class Solution(object):
    def convert(self, s, numRows):
        """
        :type s: str
        :type numRows: int
        :rtype: str
        """
        if numRows == 1:
            return s
        
        n = 2 * numRows - 2
        res = s[: : n]
        
        for i in xrange(1, n/2):
            first = s[i : : n]
            second = s[n-i : : n]
            
            res += ''.join([a+b for (a, b) in zip(first, second)])
            
            if len(first) > len(second):
                res += first[-1]
        
        res += s[n/2 : : n]
        
        return res